<template>
  <div class="serviceManage">
    <div class="detail">
      <div class="head"><span>意见详情</span></div>
      <div class="info">
        <table>
          <tr>
            <td>反馈日期 :</td>
            <td>{{ info.adviseTime ?setLocalTime(info.adviseTime):info.adviseTime }}</td>
          </tr>
          <tr>
            <td>意见类型 :</td>
            <td>{{ info.adviseType }}</td>
          </tr>

          <tr>
            <td>反馈人 :</td>
            <td>{{ info.userName }}</td>
          </tr>
          <tr>
            <td>邮箱 :</td>
            <td>{{ info.userPhone }}</td>
          </tr>
          <tr>
            <td class="desc">描述 :</td>
            <td>{{ info.adviseContent }}</td>
          </tr>
          <tr>
            <td>照片 :</td>
            <td class="flex-start"><div v-for="(item,index) in info.imgSrc " :key="index" class="pic">
             <el-image

    :src="item"
    :preview-src-list="[info.imgSrc]">
  </el-image>
              </div>
              <!-- <div class="pic">
              {{info.adviseImgs}}
              </div> -->
              </td>

          </tr>
        </table>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
    }
  },
  created () {
    const id = Number(sessionStorage.getItem('id'))
    this.$store.dispatch('feedback/getDetailData', id).then(res => {
      // console.log(res.data)
    }).catch(err => {
      this.$message({
        type: 'error',
        message: err,
        duration: 1000
      })
    })
  },

  computed: {
    // id () {
    //   return Number(sessionStorage.getItem('id'))
    // },
    info () {
      // // console.log(this.id)
      return this.$store.state.feedback.tableData
    }
  },
  methods: {
    setLocalTime (time) {
      return this.$moment(+new Date(time)).format('YYYY-MM-DD HH:mm:ss')
    }
  }
}
</script>

<style lang="scss" scoped>
.serviceManage {
  .detail {
    min-height: 932px;
    box-sizing: border-box;
    background: #ffffff;
    border-radius: 8px;
    // margin-top: 24px;
    padding: 0 24px;
  }
  .head {
    width: 100%;
    height: 78px;
    border-bottom: 1px solid #e6e9f0;
    position: relative;
    font-size: 16px;
    font-weight: 500;
    color: #1b1f35;
    span {
      position: absolute;
      bottom: 20px;
    }
  }
  .info {
    margin-top: 53px;
    margin-left: 20px;
    tr {
      color: #3d4966;
      vertical-align: top;
      td:nth-child(1) {
        width: 76px;
        height: 50px;
        color: #1b1f35;
        text-align: right;
      }
      td:nth-child(2) {
        padding-left: 20px;

      }
    }
  }
  .pic {
    width: 120px;
    height: 120px;
    opacity: 0.6;
    border: 1px solid #c6ccd7;
    border-radius: 5px;
    margin-right: 20px;
  }
}
</style>
